package com.atguigu.gulimall.auth.feign;


import com.atguigu.common.utils.R;
import com.atguigu.gulimall.auth.vo.SocialUser;
import com.atguigu.gulimall.auth.vo.UserLoginVo;
import com.atguigu.gulimall.auth.vo.UserRegisterVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description:
 * @Created: with IntelliJ IDEA.
 * @author: hzh
 * @createTime: 2020-06-27 17:10
 **/

@FeignClient("gulimall-member")
public interface MemberFeignService {

    /**
     * 注册远程调用
     * @param vo
     * @return
     */
    @PostMapping(value = "/member/member/register")
    R register(@RequestBody UserRegisterVo vo);

    /**
     * 登录远程调用
     * @param vo
     * @return
     */

    @PostMapping(value = "/member/member/login")
    R login(@RequestBody UserLoginVo vo);

    /**
     * weibo登录远程调用
     * @param socialUser
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/member/member/oauth2/login")
    R oauthLogin(@RequestBody SocialUser socialUser) throws Exception;

//    @PostMapping(value = "/member/member/weixin/login")
//    R weixinLogin(@RequestParam("accessTokenInfo") String accessTokenInfo);

    /**
     * gitee登录远程调用
     * @param giteeInfo
     * @return
     */
    @PostMapping("/member/member/giteelogin")
    R giteeLogin(@RequestParam("giteeInfo") String giteeInfo);
}
